package dao.jdbc.util;


import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class DBConnectionFactory {
	
	public static Connection getConnection() throws SQLException
	{
		try {
			 Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver"); 
	         String connectionUrl = "jdbc:sqlserver://KHULE:1433;" + 
	                                 "database=Test;" + 
	                                 "user=sa;" + 
	                                 "password=123456"; 
	         Connection con = DriverManager.getConnection(connectionUrl);
	         return con;
		} catch (ClassNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return null; 
	}
}

